#pragma once

#include"HashTable.h"

namespace sxn
{

	template<class K, class Hash = HashFunc<K>>
	class unordered_set
	{
		template<class K>
		struct KofT
		{
			const K& operator()(const K& k)
			{
				return k;
			}
		};
	public:
		typedef typename hash_bucket::HashTable<K, const K, KofT<K>, Hash>::Iterator iterator;
		typedef typename hash_bucket::HashTable<K, const K, KofT<K>, Hash>::ConstIterator const_iterator;
	public:
		pair<iterator, bool> insert(const K& k)
		{
			return _ht.Insert(k);
		}
		iterator find(const K& k)
		{
			return _ht.Find(k);
		}
		bool erase(const K& k)
		{
			return _ht.Erase(k);
		}
		iterator begin()
		{
			return _ht.begin();
		}
		iterator end()
		{
			return _ht.end();
		}
		const_iterator cbegin()const
		{
			return _ht.begin();
		}
		const_iterator cend()const
		{
			return _ht.end();
		}
	private:
		hash_bucket::HashTable<K, const K, KofT<K>, Hash>  _ht;
	};
}